FROM node:12

WORKDIR /home/code

COPY . .

COPY sources.list /etc/apt/sources.list

RUN apt-get update \
    && apt-get install nginx -y \
    && npm install --registry=https://registry.npm.taobao.org \
    && npm run build \
    && rm sources.list \
    && rm nginx.conf

COPY nginx.conf /etc/nginx/nginx.conf

EXPOSE 80

# CMD ["npm","run","http"]
# CMD ["service","nginx","start","-g",'daemon off']
# CMD ["service","nginx","start"]
CMD ["nginx","-g","daemon off;"]